package com.yonyou.crm.sys.role.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.common.page.entity.Page;
import com.yonyou.crm.sys.role.entity.RoleVO;
import com.yonyou.crm.sys.role.rmitf.IRoleRmService;
import com.yonyou.crm.sys.role.service.RoleBizServiceImpl;
import com.yonyou.crm.sys.user.entity.UserVO;
@Service("roleService")
public class RoleRmServiceImpl implements IRoleRmService {

	@Autowired
	private RoleBizServiceImpl bizService;
	@Override
	public List<RoleVO> getRoleListByTenantId(Map<String, Object> param) {
		return bizService.getRoleListByTenantId(param);
	}

	@Override
	public RoleVO getRoleDetail(Long id) {
		return bizService.getROleDetail(id);
	}

	@Override
	public List<RoleVO> getUserRole(Long id) {
		return bizService.getUserRole(id);
	}

	@Override
	public RoleVO insertRole(RoleVO role) {
		return bizService.insertRole(role);
	}

	@Override
	public RoleVO updateRole(RoleVO role) {
		return bizService.updateRole(role);
	}

	@Override
	public int deleteRole(Long id) {
		return bizService.deleteRole(id);
	}

	@Override
	public boolean assignUser(long roleId, String[] userIds) {
		return bizService.insertUserRole(roleId, userIds);
	}

	@Override
	public Page<UserVO> getPersonals(Page<UserVO> requestPage, Long roleId) {
		
		return bizService.getPersonals(requestPage,roleId);
	}

	@Override
	public boolean unAssignUser(long roleId, String[] userIds) {
		return bizService.unAssignUser(roleId,userIds);
	}

	@Override
	public List<Map<String, Object>> getRoleTypes() {
		return bizService.getRoleTypes();
	}

	@Override
	public List<RoleVO> getRefList(String param) {
		return bizService.getRefList(param);
	}

	@Override
	public List<UserVO> getAddPersonals(String name, String orgId, Long roleId) {
		
		return bizService.getAddPersonals(name,orgId,roleId);
	}
}
